<template>
    <div>
      <h3>这是第十四个demo:ref在标签上的使用</h3>
      <h4 ref="today">今天天气真好</h4>
      <button @click="showH4">输出</button>
    </div>
  </template>
  
  <script setup lang="ts" name="Demo14">
  import { ref} from 'vue'
  let today = ref();
  console.log(today,'1');
  console.log(today.value,'2')
  
  let a1 = ref(0)
  let a2 = ref(1)
  let a3 = ref(2)

  function showH4() {
      console.log(today.value,'3')
      console.log(today.value.innerText,'4');
  }

//宏函数defineExpose做一个抛出
  defineExpose({a1,a2,a3,today})

  //先加载组件，再加载整个页面
 
  </script>
  <style lang='scss' scoped>
  
  </style>